package com.lgj.demo0812.threads;


/**
 * @author lizy51
 * @date 2022-08-25 15:06
 */
public class Demo02 {
    static Object obj = new Object();

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    System.out.println("-----start-----");
//                    synchronized (obj) {
//                        obj.wait();
//                    }
                    System.out.println("-----end-----");
                } catch (Exception e) {
                    e.printStackTrace();
                    System.out.println("****出错啦****");
                }
            }
        });
        thread.start();
        System.out.println("----start interrupt-----");
//        thread.join();
//        thread.interrupt();
//        Thread.sleep(1000);
//        synchronized (obj){
//            obj.notify();
//        }
        System.out.println("----end interrupt-----");
    }
}
